<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>子代选择器</title>
  <style>
    div > span {
        color: red;
    }
  </style>
</head>
<body>
<div>
  <span>儿子span标签</span>
  <p>
    <span>孙子span标签</span>
  </p>
</div>

</body>
</html>